<template>
  <div class="img-list-detail">
    <div
      v-for="(item,key) in imageList"
      :key="key"
      class="img-content-detail"
    >
      <img :src="item.url">
      <!-- 放大icon -->
      <div
        class="layer-detail"
        @click="handleFileEnlarge(item.url)"
      >
        <i class="el-icon-view" />
      </div>
    </div>
    <!-- <el-dialog title="" :visible.sync="isEnlargeImage" size="large" :append-to-body="true" top="8%" width="60%">
			<img @click="isEnlargeImage = false" style="width:100%;" :src="enlargeImage">
		</el-dialog> -->
  </div>
</template>

<script>
export default {
  name: 'UploadImageDetail',
  props: {
    imageList: {
      type: Array,
      default () {
        return []
      }
    },
    linkTable: String,
    linkId: String,
    linkField: String
  },
  data () {
    return {
      // isEnlargeImage: false, // 放大图片
      // enlargeImage: '', // 放大图片地址
      dataForm: {
        token: `${this.$cookie.get('token')}`,
        linkTable: this.linkTable,
        linkId: this.linkId,
        linkField: this.linkField
      }
    }
  },
  computed: {
    proStatus () {
      // 上传状态
      if (this.pass) {
        return 'success'
      } else if (this.pass === false) {
        return 'exception'
      } else {
        return ''
      }
    }
  },
  methods: {
    handleFileEnlarge (_url) {
      // 放大图片
      window.open(_url)
      // if (_url) {
      //   window.open(_url)
      //   // this.enlargeImage = _url
      //   // this.isEnlargeImage = !this.isEnlargeImage
      // }
    }
  }
}
</script>

<style>
* {
  box-sizing: border-box;
}
.img-list-detail {
  overflow: hidden;
  width: 100%;
}
.img-list-detail .img-content-detail {
  float: left;
  text-align: left;
  position: relative;
  display: inline-block;
  width: 200px;
  height: 200px;
  padding: 5px;
  margin: 5px 20px 0px 0;
  border: 1px solid #d1dbe5;
  border-radius: 4px;
  transition: all 0.3s;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
}
.img-list-detail .img-upload-detail {
  float: left;
  width: 200px;
  height: 200px;
  display: table;
  text-align: center;
}
.img-list-detail .uploader-detail {
  width: 100%;
  display: table-cell;
  vertical-align: middle;
}
.img-list-detail .img-progress-detail {
  text-align: center;
  padding-top: 50px;
}
.img-list-detail .img-content-detail img {
  display: block;
  width: 100%;
  height: 190px;
  margin: 0 auto;
  border-radius: 4px;
}
.img-list-detail .img-content-detail .name-detail {
  margin-top: 10px;
}
.img-list .img-content .name-detail > div {
  width: 90%;
  text-overflow: ellipsis;
  overflow: hidden;
  height: 25px;
  line-height: 25px;
}
.img-list-detail .img-content-detail:hover .del-detail,
.img-list-detail .img-content-detail:hover .layer-detail {
  opacity: 1;
}
.img-list-detail .img-content-detail .del-detail,
.img-list-detail .img-content-detail .layer-detail {
  opacity: 0;
  transition: all 0.3s;
}
.img-list-detail .img-content-detail .del-detail {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: #8492a6;
  cursor: pointer;
  font-size: 1.1em;
}
.img-list-detail .img-content-detail .layer-detail {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 200px;
  color: #fff;
  text-align: center;
  z-index: 5;
  background-color: rgba(0, 0, 0, 0.4);
}
.img-list-detail .img-content-detail .layer-detail i {
  font-size: 1.6em;
  margin-top: 80px;
}
</style>
